package com.jboost.hyk.common.entity;


import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.jboost.common.system.base.entity.JBoostEntity;

/**
 * @Description: 机构账号数量
 * @Author: cxn
 * @Date:   2022-10-22
 * @Version: V1.0
 */
@Data
@TableName("hyk_business_account_num")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="hyk_business_account_num对象", description="机构账号数量")
public class BusinessAccountNum extends JBoostEntity{

    /**机构id*/
    @ApiModelProperty(value = "机构id")
    private String businessId;

    /**订单 id*/
    @ApiModelProperty(value = "订单 id")
    private String orderId;

    @ApiModelProperty(value = "订单商品类型：package-套餐")
    private String itemType;

    /**账号总数*/
    @ApiModelProperty(value = "账号总数")
    private Integer total;

    /**已使用数量*/
    @ApiModelProperty(value = "已使用数量")
    private Integer used;

    public Integer surplusNum(){
        if (null == total || total == 0){
            return 0;
        }
        return total-used;
    }

}
